{{partial('public/header')}}

{% if visitor %}
<script>
    //var POPUP_REG = true; 
</script>
{% endif %}

<!--main-->
<div class="midder">

<div class="mc">
<div id="group-info">
	<img align="left" alt="{{strGroup['groupname']}}" src="{{strGroup['icon_48']}}" class="pil mr10 groupicon"/>
    <h1 class="group_tit">{{strGroup['groupname']}}
    {% if strGroup['isaudit']==1 %}<font class="red">[审核中]</font>{% endif %}</h1>

    <div class="group-misc">
   
    {% if isGroupUser and  strGroup['userid']!=visitor['userid'] and isGroupUser['isadmin']!=1 %}
    <span class="fleft mr5 color-gray">我是这个小组的{{strGroup['role_user']}} 
    <a class="j a_confirm_link" href="{{url('group/manage/quit/'~strGroup['groupid'])}}" style="margin-left: 6px;">&gt;退出小组</a></span>
    {% elseif isGroupUser and  strGroup['userid']!=visitor['userid'] and isGroupUser['isadmin']==1%}
    <span class="fleft mr5 color-gray">我是这个小组的{{strGroup['role_admin']}}</span>    
    {% elseif isGroupUser and  strGroup['userid']==visitor['userid'] %}
    <span class="fleft mr5 color-gray">我是这个小组{{strGroup['role_leader']}}</span>
    {% endif %}
    
    {% if strGroup['joinway']==0 and !isGroupUser %}
    	{% if visitor%}
        <a rel="nofollow" class="button-join" href="{{url('group/manage/join/'~strGroup['groupid'])}}">
            <span>加入小组</span>
        </a>
        {%else%}
        <a rel="nofollow" class="button-join  i a_show_login" href="{{url('group/manage/join/'~strGroup['groupid'])}}">
            <span>加入小组</span>
        </a>        
        {% endif %}
    {% endif %}
    {% if strGroup['joinway']!=0 %}
    	<span>本小组禁止加入</span>
    {% endif %}
	</div>
    
</div>

<div class="cleft">
<div class="infobox">

<div class="bd">
    <p class="leaderhd">创建于{{date('Y-m-d H:i:s',strGroup['addtime'])}}&nbsp; &nbsp; {{strGroup['role_leader']}}：<a href="{{url('group/people/'~strLeader['doname'])}}">{{strLeader['username']}}</a></p>
    {{strGroup['groupdesc']|nl2br}}
</div>

</div>

<div class="box">

<div class="box_content" id="topics"> 

    <div id="group-new-topic-bar">
        <div class="bns">
        	{% if visitor %}
            <a class="bn-post1 bn-post-link" href="{{url('group/topic/addnews/'~strGroup['groupid'])}}"><span><i class="link-icon"></i>贴新闻</span></a>
            <a class="bn-post1" href="{{url('group/topic/add/'~strGroup['groupid'])}}"><span><i>+</i>发言</span></a>
            {% else %}
            <a class="bn-post1 bn-post-link i a_show_login" href="{{url('group/topic/addnews/'~strGroup['groupid'])}}"><span><i class="link-icon"></i>贴新闻</span></a>
            <a class="bn-post1 i a_show_login" href="{{url('group/topic/add/'~strGroup['groupid'])}}"><span><i>+</i>发言</span></a>            
            {% endif %}
        </div>
    
        {% if type is empty %}
        <div class="topic-tab">
        <a class="on" href="{{url('group/show/'~strGroup['groupid'])}}#topics">最近话题</a> 
          <i>/</i>
        <a href="{{url('group/show/'~strGroup['groupid']~'?type=essence')}}#topics">最热话题</a>
        </div>
        {% elseif type == 'essence' %}
        <div class="topic-tab">
        <a href="{{url('group/show/'~strGroup['groupid'])}}#topics">最近话题</a> 
          <i>/</i>
        <a class="on" href="{{url('group/show/'~strGroup['groupid']~'?type=essence')}}#topics">最热话题</a>
        </div>        
        {% endif %}
    </div>
    
<div class="clear"></div>

{% if type is empty %}
<div class="indent" >
<table class="olt">
<tbody>
<tr>
    <td>话题</td>
    <td nowrap="nowrap">作者</td>
    <td nowrap="nowrap">回应</td>
    <td align="right" nowrap="nowrap">最后回应</td>
</tr>
{% if arrTopics %}
{% for item in arrTopics %}
<tr class="pl">
    <td class="td-title">
    <a title="{item['title']}" href="{{url('group/topic/'~item['topicid'])}}">
    {{sub_str(item['title'], 50)}}
    </a>
    {% if item['isvideo'] == 1 %}
    <img src="{{PUBLIC}}/images/lc_cinema.png" align="absmiddle" title="[视频]" alt="[视频]" />
    {% endif %}                
    {% if item['istop'] == 1 %}
    <img src="{{PUBLIC}}/images/headtopic_1.gif" title="[置顶]" alt="[置顶]" />
    {% endif %}
    {% if item['addtime'] > (strtotime(date('Y-m-d 00:00:00'))) %}
    <img src="{{PUBLIC}}/images/topic_new.gif" align="absmiddle"  title="[新帖]" alt="[新帖]" />
    {% endif %} 
    {% if item['isphoto'] == 1 %}
    <img src="{{PUBLIC}}/images/image_s.gif" title="[图片]" alt="[图片]" align="absmiddle" />
    {% endif %} 
    {% if item['isattach'] == 1 %}
    <img src="{{PUBLIC}}/images/attach.gif" title="[附件]" alt="[附件]" />
    {% endif %} 
    {% if item['isdigest'] == 1 %}
    <img src="{{PUBLIC}}/images/posts.gif" title="[精华]" alt="[精华]" />
    {% endif %}
    </td>
    <td nowrap="nowrap">
    <a href="{{url('group/people/'~item['user']['doname'])}}">
    {{item['user']['username']}}
    </a>
    </td>
    <td nowrap="nowrap" >{% if item['count_comment'] %}{{item['count_comment']}}{% endif %}</td>
    <td nowrap="nowrap" class="time" align="right">
      {{getTime(item['uptime'],time())}}
    </td>
</tr>
{% endfor %}
{% endif %}         
</tbody>
</table>
</div>
{% elseif type == 'essence' %}
    {% if arrEssenceTopics%}
<div class="indent" >
<table class="olt">
<tbody>
<tr>
    <td>话题</td>
    <td nowrap="nowrap">作者</td>
    <td nowrap="nowrap">回应</td>
    <td align="right" nowrap="nowrap">最后回应</td>
</tr>
{% if arrEssenceTopics %}
{% for item in arrEssenceTopics %}
<tr class="pl">
    <td class="td-title">
    <a title="{item['title']}" href="{{url('group/topic/'~item['topicid'])}}">
    {{sub_str(item['title'], 50)}}
    </a>
    {% if item['isvideo'] == 1 %}
    <img src="{{PUBLIC}}/images/lc_cinema.png" align="absmiddle" title="[视频]" alt="[视频]" />
    {% endif %}                
    {% if item['istop'] == 1 %}
    <img src="{{PUBLIC}}/images/headtopic_1.gif" title="[置顶]" alt="[置顶]" />
    {% endif %}
    {% if item['addtime'] > (strtotime(date('Y-m-d 00:00:00'))) %}
    <img src="{{PUBLIC}}/images/topic_new.gif" align="absmiddle"  title="[新帖]" alt="[新帖]" />
    {% endif %} 
    {% if item['isphoto'] == 1 %}
    <img src="{{PUBLIC}}/images/image_s.gif" title="[图片]" alt="[图片]" align="absmiddle" />
    {% endif %} 
    {% if item['isattach'] == 1 %}
    <img src="{{PUBLIC}}/images/attach.gif" title="[附件]" alt="[附件]" />
    {% endif %} 
    {% if item['isdigest'] == 1 %}
    <img src="{{PUBLIC}}/images/posts.gif" title="[精华]" alt="[精华]" />
    {% endif %}
    </td>
    <td nowrap="nowrap">
    <a href="{{url('group/people/'~item['user']['doname'])}}">
    {{item['user']['username']}}
    </a>
    </td>
    <td nowrap="nowrap" >{% if item['count_comment'] %}{{item['count_comment']}}{% endif %}</td>
    <td nowrap="nowrap" class="time" align="right">
      {{getTime(item['uptime'],time())}}
    </td>
</tr>
{% endfor %}
{% endif %}         
</tbody>
</table>
</div>    
    {% else %}
    <div class="indent">
        <p>
         这个小组暂时还没有最热话题。<br>
         当小组内的话题得到更多回应、喜欢和推荐时，最受大家喜爱的话题就会出现在这里。
        </p>
    </div>    
    {% endif %}
{% endif %}
	<div class="clear"></div>
    
	<div class="page"></div>

</div>
</div>

</div>


<div class="cright">
    <div>
        <h2>最新加入成员</h2>
        {% for item in arrGroupUser %}
        <dl class="obu">
            <dt>
            <a href="{{url('group/people/'~item['doname'])}}"><img alt="{{item['username']}}" class="m_sub_img" src="{{item['face_48']}}" /></a>
            </dt>
            <dd>{{item['username']}}<br>
                <span class="pl">({{item['area']['areaname']}})</span>
            </dd>
     	 </dl>
        {% endfor %}
    
        <br clear="all">
    
        {% if visitor['userid'] == strGroup['userid'] %}
            <p class="pl2">&gt; <a href="{{url('group/manage/members/'~strGroup['groupid'])}}">成员管理 ({{strGroup['count_user']}})</a></p>
            
            <p class="pl2">&gt; <a href="{{url('group/manage/edit/'~strGroup['groupid'])}}">修改小组设置 </a></p>
            
           {% else %}
            
            <p class="pl2">&gt; <a href="{{url('group/members/'~strGroup['groupid'])}}">浏览所有成员 ({{strGroup['count_user']}})</a></p>
        {% endif %}
        
       <div class="clear"></div>

        
    </div>
    
	<p class="pl">本页永久链接: <a href="{{url('group/show/'~strGroup['groupid'])}}">{{url('group/show/'~strGroup['groupid'])}}</a></p>
    
    <p class="pl"><span class="feed"><a href="{{url('group/rss/'~strGroup['groupid'])}}">feed: rss 2.0</a></span></p>
    
    <div class="clear"></div>
    
</div>
</div>
</div>

